package main

import (
	"fmt"
	"time"
)

func main() {
	go spainer(time.Millisecond * 10)
	fmt.Println("\n%d\n", fib(56))

}

func fib(n int) int {
	if n < 2 {
		return n
	}
	return fib(n-2) + fib(n-1)
}

func spainer(delay time.Duration) {
	//添加外测过for循环防止结束
	for {
		for _, r := range `-\|/` {
			fmt.Printf("\r%c", r)
			time.Sleep(delay)
		}
	}
}
